//
//  CircleImage.swift
//  Landmarks
//
//  Created by Hello Cai on 2020/4/3.
//  Copyright © 2020 Hello Cai. All rights reserved.
//

import SwiftUI

struct CircleImage: View {
    //提供参数
    var image: Image
    
    var body: some View {
        //Image("turtlerock")
        image
            //Circle作为蒙版，把图像裁剪成圆形
            .clipShape(Circle())
            //创建一个新的圆，添加到图像上，形成边框
            .overlay(Circle().stroke(Color.white, lineWidth: 4))
            //添加一个半径为 8 点的阴影
            .shadow(radius: 8)
    }
}

struct CircleImage_Previews: PreviewProvider {
    static var previews: some View {
        CircleImage(image: Image("turtlerock"))
    }
}
